package cn.tedu.uep.petCircle.controller;

import cn.tedu.uep.base.response.JsonResult;
import cn.tedu.uep.petCircle.pojo.dto.MyPetCircleParam;
import cn.tedu.uep.petCircle.pojo.dto.MyPetCircleQuery;
import cn.tedu.uep.petCircle.pojo.vo.MyPetCircleVo;
import cn.tedu.uep.petCircle.service.MyPetCircleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/MyPetCircle")
public class MyPetCircleController {
    @Autowired
     MyPetCircleService MyPetCircleService;
    @PostMapping("/v1/myPetCircle/insert")
    public JsonResult insertmyPet_circle(MyPetCircleParam myPetCircleParam){
        MyPetCircleService.insertmyPet_circle(myPetCircleParam);
        log.debug("在我的宠圈页面下新增发布 myPetCircle={}",myPetCircleParam);
        return JsonResult.ok();
    }
    @GetMapping("v1/myPetCircle/select")
    public JsonResult selectmyPet_circle(MyPetCircleQuery myPetCircleQuery){
        List<MyPetCircleVo> myPetCircleVoList = MyPetCircleService.selectmyPet_circle(myPetCircleQuery);
        log.debug("查询用户发布的所有宠圈内容 myPetCircleQuery={}",myPetCircleQuery);
        return JsonResult.ok();
    }


}
